package com.sample.wanandroidx.dialog

import android.content.Context
import android.view.View
import com.lxj.xpopup.core.CenterPopupView
import com.sample.wanandroidx.R
import com.sample.wanandroidx.app.App

class ExpiresDialog(context: Context) : CenterPopupView(context) {

    // XPopup.Builder(this).asCustom(PrivacyDialog(this)).show()

    override fun getImplLayoutId(): Int {
        return R.layout.dialog_expires
    }

    override fun onCreate() {
        super.onCreate()
        findViewById<View>(R.id.ok).setOnClickListener {
            //基于这里的写法,直接清空用户数据 之后判断用户数据是否为空就好
            App.user = null

            dismiss()
            App.instance().getCurrentVisibleActivity()?.finish()
        }

    }

}